<?php
//include('../../__global.php');
class ml_model_rdsPic extends ml_model_redis  
{    
    const PFX_PIC_PIN_HEIGHT = 'pinH_';
    
    function __construct() {
        if(!$this->init_rds('meila_cnt'))
            return false;
    }
    

    public function getPicPinHeight($aPid)
    {
        
        foreach ($aPid as &$pid)
        $aKey[] = self::PFX_PIC_PIN_HEIGHT .$pid;

        $aRs = $this->mget($aKey);
        $this->set_data( array_combine($aPid , $aRs) );
        return true;
    }
    
    public function setPicPinHeight($pid , $height)
    {
        
        $key = self::PFX_PIC_PIN_HEIGHT.$pid;
        return $this->set($key, $height);
    }

}
/*
$a = new ml_model_rdsPic();
$a->setPicPinHeight('test', '123');
$aPid = array('test');
$re = $a->getPicPinHeight($aPid);
$re = $a->get_data();
var_dump($re);
*/